import request from '@/utils/request'

// get 获得资讯管理列表数据
export function getNewInformation(params) {
  return request({
    url: '/ops/article/list',
    method: 'get',
    params: {tenantId: params}
  })
}

// get 获得栏目管理数据
export function getCategory(tenantId) {
  return request({
    url: '/ops/articleCategory/list',
    method: 'get',
    params: {tenantId: tenantId}
  })
}

// post 资讯管理列表status更新
export function updateStatus(data) {
  return request({
    url: '/ops/article/update',
    method: 'post',
    data
  })
}

// post 资讯管理列表行删除
export function DeleteStatus(id) {
  return request({
    url: '/ops/article/delete',
    method: 'get',
    params: {id}
  })
}

// post 新增资讯提交按钮
export function addNewInformation(data) {
  return request({
    url: '/ops/article/add',
    method: 'post',
    headers: {
      // 'Content-Type': 'application/x-www-json-urlencoded;charset=UTF-8'
      // 'Content-Type': 'application/json;charset=UTF-8'
      // 'Content-Type': 'application/x-www-form-urlencoded'
    },
    data: data
  })
}

// post 新增资讯提交按钮
export function updateInformation(data) {
  return request({
    url: '/ops/article/update',
    method: 'post',
    data: data
  })
}

// post 修改资讯栏目提交按钮
export function updateCategory(data) {
  return request({
    url: '/ops/articleCategory/update',
    method: 'post',
    data: data
  })
}

// post 新增资讯栏目提交按钮
export function addCategory(data) {
  return request({
    url: '/ops/articleCategory/add',
    method: 'post',
    data: data
  })
}

// get 新增资讯栏目提交按钮
export function deleteCategory(params) {
  return request({
    url: '/ops/articleCategory/delById',
    method: 'get',
    params: {id: params}
  })
}
